home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 44 / Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso / -in_the_mag- / basics / amos / kyzeramoscode.lha / 5LineTron.AMOS / 5LineTron.amosSourceCode next >
AMOS Source Code  |  1992-09-03  |  1KB  |  21 lines

  1. ' 5 line Tron by Kyzer of CSG
  2. ' these 3 lines don't count. 
  3. '
  4. S=2 : R=8
  5. ' S is the speed, R is the no. of rounds   
  6. ' These 4 lines don't count either.  
  7. '
  8. Dim DX(1),DY(1),X(3),Y(3),D(1) : Hide : For Z=1 To R : Unpack 6 To 0 : Pen 1 : Paper 0 : Restore : For A=0 To 1 : Read DX(A),DY(A),X(A),Y(A),D(A) : Next : X(2)=X(0) : X(3)=X(1) : Y(2)=Y(0) : Y(3)=Y(1) : Repeat : Wait Vbl 
  9. For A=0 To 1 : X=Jleft(A)-Jright(A) : Y=Jup(A)-Jdown(A) : If(X or Y) and X*Y=0 and(DX(A)*X<>-1) and(DY(A)*Y<>-1) : DX(A)=X : DY(A)=Y : End If : Add X(A),DX(A)*S : Add Y(A),DY(A)*S
  10. D(A)=-Point(X(A),Y(A)) : Ink A+2 : Draw X(A),Y(A) To X(A+2),Y(A+2) : X(A+2)=X(A) : Y(A+2)=Y(A) : Next A : Until D(0) or D(1) : Boom : Print At(12,0);"Player";2+(D(1)<>0);" wins!!" : Repeat : Until Fire(0) or Fire(1)
  11. If D(1) : Inc W1 Else Inc W2 : End If : Next Z : Print At(6,2);"After";Z-1;" round(s),";At(10,4);"Player 1 has";W1;" points,";At(6,5);"and Player 2 has";W2;" points!"
  12. Data 1,0,20,100,0,-1,0,300,100,0
  13. '  ____    
  14. '  \__/\   This picture of me with my nice new hat definately
  15. '  /..\    doesn't count at all. Not in the slightest. OK? 
  16. ' {  ï¿½ } 
  17. '  \_�/
  18. '   /n\
  19. '  ï¿½ U ï¿½ 
  20. '   / \
  21. '